package com.sky.volunteer.service.impl;

import java.util.List;
import com.sky.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sky.volunteer.mapper.TbVolunteerMapper;
import com.sky.volunteer.domain.TbVolunteer;
import com.sky.volunteer.service.ITbVolunteerService;

/**
 * 志愿者信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-11-08
 */
@Service
public class TbVolunteerServiceImpl implements ITbVolunteerService 
{
    @Autowired
    private TbVolunteerMapper tbVolunteerMapper;

    /**
     * 查询志愿者信息
     * 
     * @param id 志愿者信息主键
     * @return 志愿者信息
     */
    @Override
    public TbVolunteer selectTbVolunteerById(Long id)
    {
        return tbVolunteerMapper.selectTbVolunteerById(id);
    }

    /**
     * 查询志愿者信息列表
     * 
     * @param tbVolunteer 志愿者信息
     * @return 志愿者信息
     */
    @Override
    public List<TbVolunteer> selectTbVolunteerList(TbVolunteer tbVolunteer)
    {
        return tbVolunteerMapper.selectTbVolunteerList(tbVolunteer);
    }

    /**
     * 新增志愿者信息
     * 
     * @param tbVolunteer 志愿者信息
     * @return 结果
     */
    @Override
    public int insertTbVolunteer(TbVolunteer tbVolunteer)
    {
        tbVolunteer.setCreateTime(DateUtils.getNowDate());
        return tbVolunteerMapper.insertTbVolunteer(tbVolunteer);
    }

    /**
     * 修改志愿者信息
     * 
     * @param tbVolunteer 志愿者信息
     * @return 结果
     */
    @Override
    public int updateTbVolunteer(TbVolunteer tbVolunteer)
    {
        tbVolunteer.setUpdateTime(DateUtils.getNowDate());
        return tbVolunteerMapper.updateTbVolunteer(tbVolunteer);
    }

    /**
     * 批量删除志愿者信息
     * 
     * @param ids 需要删除的志愿者信息主键
     * @return 结果
     */
    @Override
    public int deleteTbVolunteerByIds(Long[] ids)
    {
        return tbVolunteerMapper.deleteTbVolunteerByIds(ids);
    }

    /**
     * 删除志愿者信息信息
     * 
     * @param id 志愿者信息主键
     * @return 结果
     */
    @Override
    public int deleteTbVolunteerById(Long id)
    {
        return tbVolunteerMapper.deleteTbVolunteerById(id);
    }
}
